package com.platform.core.entity;

import com.platform.dto.SysDataStandardDto;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * Description: ncloud_sys_data_standard实体类
 *
 * @author Coder
 */
@Setter
@Getter
@Entity
@Table(name = "ncloud_sys_data_standard")
public class SysDataStandardEntity implements Serializable {

    /**
    * 主键ID ID-c:hidden
    */
    @Id
    @GenericGenerator(name = "system-uuid", strategy = "uuid")
    @GeneratedValue(generator = "system-uuid")
    private String id;

    /**
    * 类型
    */
    @Column(name = "type", nullable = false )
    private String type;

    /**
    * 名称
    */
    @Column(name = "name", nullable = false )
    private String name;

    /**
    * 编码
    */
    @Column(name = "code", nullable = false )
    private String code;

    /**
    * 描述
    */
    @Column(name = "stand_desc" )
    private String standDesc;

    /**
    * 附件
    */
    @Column(name = "attachment" )
    private String attachment;

    /**
    * 标准来源
    */
    @Column(name = "stand_origin" )
    private String standOrigin;

    /**
    * 排序编号
    */
    @Column(name = "sort_num" )
    private Integer sortNum;

    /**
    * 删除标志
    */
    @Column(name = "flag" )
    private String flag;

    /**
    * 创建日期
    */
    @Column(name = "create_date" )
    private LocalDateTime createDate;

    /**
    * 创建人
    */
    @Column(name = "create_by" )
    private String createBy;

    /**
    * 更新日期
    */
    @Column(name = "update_date" )
    private LocalDateTime updateDate;

    /**
    * 更新人
    */
    @Column(name = "update_by" )
    private String updateBy;

    public SysDataStandardDto toDto() {
        SysDataStandardDto vo = new SysDataStandardDto();

        vo.setId(getId());
        vo.setType(getType());
        vo.setName(getName());
        vo.setCode(getCode());
        vo.setStandDesc(getStandDesc());
        vo.setAttachment(getAttachment());
        vo.setStandOrigin(getStandOrigin());
        vo.setSortNum(getSortNum());
        vo.setFlag(getFlag());
        vo.setCreateDate(getCreateDate());
        vo.setCreateBy(getCreateBy());
        vo.setUpdateDate(getUpdateDate());
        vo.setUpdateBy(getUpdateBy());

        return vo;
    }
}
